import java.util.ArrayList;

public class Exercise15_02{
    public static void main(String[] args){
        T t = new T();
        t.addAndSort(1);
        t.show();
        System.out.println("******************");      
        t.addAndSort(2);
        t.show();
    }
}

class T{
    ArrayList<Integer> alist = new ArrayList<Integer>();
    
    public void addAndSort(int elem){
        alist.add(elem);
        for(int i = 0; i < alist.size() - 1; i++){
            for(int j = i + 1; j < alist.size(); j++){
                if(alist.get(i) < alist.get(j)){
                    int temp = alist.set(i, alist.get(j));
                    alist.set(j, temp);
                }
            }
        }
    }
    
    public void show(){
        for(int i = 0; i < alist.size(); i++){
            System.out.println(alist.get(i));
        }
    }
}